#ifndef _FLT_DISPLIB_H_
#define _FLT_DISPLIB_H_

#include <stdint.h>
#include <dataproc.h>

#ifdef __cplusplus
extern "C"
{
#endif

	typedef struct
	{
		int16_t sv;							
		int16_t pv;							
		int8_t coef;						
		int8_t lag_rang;					
		uint16_t rise_period;				
		uint16_t fall_period;				
		uint16_t quit_delay_sv;				
		uint16_t entry_delay_sv;			
		int16_t follow_positive_max;		
		int16_t follow_negative_max;		
		uint8_t pulse : 1;					
		uint8_t enable : 1;					
		
		uint8_t st_follow : 1;              
		uint8_t st_comp : 1;	            

		uint16_t follow_time_cnt; 
		int16_t disp_val;  
		int16_t sv_old;	   
		int16_t pv_old;	   

		uint16_t quit_delay_cnt;  
		uint16_t entry_delay_cnt; 
		lag16_type disp;		  
	} disp_flt_t;

	void disp_flt_mixed(disp_flt_t *obj);
	void disp_flt_reset(disp_flt_t *obj);

	typedef struct
	{
		int32_t sv;							
		int32_t pv;							
		int8_t coef;						
		int8_t lag_rang;					
		uint16_t rise_period;				
		uint16_t fall_period;				
		uint16_t quit_delay_sv;				
		uint16_t entry_delay_sv;			
		int32_t follow_positive_max;		
		int32_t follow_negative_max;		
		uint8_t pulse : 1;					
		uint8_t enable : 1;					
		
		uint8_t st_follow : 1;              
		uint8_t st_comp : 1;	            

		uint16_t follow_time_cnt; 
		int32_t disp_val;  
		int32_t sv_old;	   
		int32_t pv_old;	   

		uint16_t quit_delay_cnt;  
		uint16_t entry_delay_cnt; 
		lag32_type disp;		  
	} disp32_flt_t;

	void disp32_flt_mixed(disp32_flt_t *obj);
	void disp32_flt_reset(disp32_flt_t *obj);

#ifdef __cplusplus
}
#endif

#endif 
